home *** CD-ROM | disk | FTP | other *** search
/ Aminet 37 / Aminet 37 (2000)(Schatztruhe)[!][Jun 2000].iso / Aminet / dev / lang / sofa.lha / sofa / smalleiffel / lib_se / proc_call.e < prev    next >
Text File  |  2000-03-25  |  3KB  |  89 lines

  1. --          This file is part of SmallEiffel The GNU Eiffel Compiler.
  2. --          Copyright (C) 1994-98 LORIA - UHP - CRIN - INRIA - FRANCE
  3. --            Dominique COLNET and Suzanne COLLIN - colnet@loria.fr
  4. --                       http://SmallEiffel.loria.fr
  5. -- SmallEiffel is  free  software;  you can  redistribute it and/or modify it
  6. -- under the terms of the GNU General Public License as published by the Free
  7. -- Software  Foundation;  either  version  2, or (at your option)  any  later
  8. -- version. SmallEiffel is distributed in the hope that it will be useful,but
  9. -- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  10. -- or  FITNESS FOR A PARTICULAR PURPOSE.   See the GNU General Public License
  11. -- for  more  details.  You  should  have  received a copy of the GNU General
  12. -- Public  License  along  with  SmallEiffel;  see the file COPYING.  If not,
  13. -- write to the  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14. -- Boston, MA 02111-1307, USA.
  15. --
  16. deferred class PROC_CALL
  17.    --
  18.    -- For all sort of procedure calls.
  19.    -- Does not include function calls (see CALL).
  20.    --
  21.    -- Classification: E_PROC_0 when 0 argument, PROC_CALL_1 when
  22.    -- 1 argument and PROC_CALL_N when N arguments.
  23.    --
  24.  
  25. inherit CALL_PROC_CALL; INSTRUCTION redefine stupid_switch;
  26.  
  27. feature
  28.  
  29.    is_pre_computable: BOOLEAN is false;
  30.  
  31.    end_mark_comment: BOOLEAN is false;
  32.  
  33.    run_feature: RUN_FEATURE;
  34.  
  35.    frozen stupid_switch(r: ARRAY[RUN_CLASS]): BOOLEAN is
  36.       do
  37.          Result := call_proc_call_stupid_switch(r);
  38.       end;
  39.  
  40.    frozen compile_to_c is
  41.       do
  42.          cpp.se_trace_ins(start_position);
  43.          call_proc_call_c2c;
  44.       end;
  45.  
  46. feature {RUN_FEATURE_3,RUN_FEATURE_4}
  47.  
  48.    finalize is
  49.       local
  50.          rc: RUN_CLASS;
  51.          rf: RUN_FEATURE;
  52.       do
  53.          rf := run_feature;
  54.          rc := rf.current_type.run_class;
  55.          run_feature := rc.running.first.dynamic(rf);
  56.       end;
  57.  
  58. feature {CREATION_CALL}
  59.  
  60.    make_runnable(w: like target; a: like arguments;
  61.                  rf: RUN_FEATURE): like Current is
  62.       require
  63.          w /= Void
  64.       deferred
  65.       end;
  66.  
  67. feature {PROC_CALL}
  68.  
  69.    set_run_feature(rf: like run_feature) is
  70.       do
  71.          run_feature := rf;
  72.       ensure
  73.          run_feature = rf
  74.       end;
  75.  
  76. feature {NONE}
  77.  
  78.    frozen run_feature_has_no_result is
  79.       do
  80.          if run_feature.result_type /= Void then
  81.             eh.add_position(run_feature.start_position);
  82.             eh.add_position(feature_name.start_position);
  83.             fatal_error("Feature found is not a procedure.");
  84.          end;
  85.       end;
  86.  
  87. end -- PROC_CALL
  88.  
  89.